import { iup } from '../../util';
import { info, wfAlert } from './util';

/**
 * 获取打印模板列表
 */
export async function getPrintTemplate(params) {
  const { code, message, data } = await iup.request.body({
    url: '/portal/print/page',
    data: params
  });
  if (code === 0) {
    return data || {};
  } else {
    await wfAlert(info.alertTitle, message || info.paramError);
  }
}

/**
 * 获取打印服务器地址
 *
 */
export async function getPrintServer() {
  const resp = await iup.request.get({
    url: '/portal/print/getPrintServer'
  });
  return resp;
}
